<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var arr = [
      [1,2,3],
      [4,5,6],
      [7,8,9]
    ]

    // reduce是从左往右归并,reduceRight从右往左
    // reduceRight的语法和reduce是完全一样的
    var arr1 = arr.reduceRight(function (res, curr) {
      return res.concat(curr)
    }, [])

    console.log(arr1) // [7,8,9,4,5,6,1,2,3]

  </script>
</body>
</html>